package com.caow.composebase

import android.app.Application
import com.alibaba.android.arouter.launcher.ARouter
import com.caow.composebase.utils.LogUtils
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.startKoin
import org.koin.core.logger.Level

/**
 * @Author caow
 * 2022/11/24
 */
object GlobalConfig {

    var DEBUG = false
    var baseUrl = ""

    lateinit var app: Application

    fun init(app: Application, debug: Boolean, baseUrl: String, showLog: Boolean = debug) {
        this.app = app
        DEBUG = debug
        LogUtils.showLog = showLog
        this.baseUrl = baseUrl

        if (BuildConfig.DEBUG){
            ARouter.openLog()
            ARouter.openDebug()
        }
        ARouter.init(app)
    }

}